Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(leak): don't mutate logger, just make events from it #69

Merged
merged 4 commits into from
Mar 1, 2024
Merged

fix(leak): don't mutate logger, just make events from it #69

merged 4 commits into from
Mar 1, 2024

Conversation

mgabeler-lee-6rs
Copy link
Contributor

@mgabeler-lee-6rs mgabeler-lee-6rs commented Dec 7, 2023

fixes: #68, #78

The bug also appears without using the customized logger, but it only manifests as a memory leak because the ConsoleWriter obscures the duplicate data in the logger context.

When using a custom logger, reproducing the issue requires concurrent requests ... which is a pretty common thing in real apps :)

@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e6115f7) 94.24% compared to head (91b371c) 93.84%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
- Coverage   94.24%   93.84%   -0.40%     
==========================================
  Files           2        2              
  Lines         139      130       -9     
==========================================
- Hits          131      122       -9     
  Misses          5        5              
  Partials        3        3              
Flag Coverage Δ
go- 93.84% <100.00%> (-0.40%) ⬇️
go-1.18 93.84% <100.00%> (-0.40%) ⬇️
go-1.19 93.84% <100.00%> (-0.40%) ⬇️
go-1.20 93.84% <100.00%> (-0.40%) ⬇️
go-1.21 93.84% <100.00%> (-0.40%) ⬇️
macos-latest 93.84% <100.00%> (-0.40%) ⬇️
ubuntu-latest 93.84% <100.00%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This was referenced Jan 8, 2024
@oliver202301
Copy link

Hi
When do you expect to merge this pull request?

@mgabeler-lee-6rs
Copy link
Contributor Author

I have no control over that, it requires a maintainer to review & merge it

@appleboy
Copy link
Member

appleboy commented Feb 2, 2024

I will take it.

@appleboy appleboy added the bug Something isn't working label Feb 2, 2024
@appleboy
Copy link
Member

appleboy commented Feb 2, 2024

@mgabeler-lee-6rs Could you help to fix the conflicts?

@mgabeler-lee-6rs
Copy link
Contributor Author

@appleboy done!

@oltur
Copy link

oltur commented Feb 18, 2024

Please merge, it is really annoying

@jimydavis
Copy link

@appleboy please merge this soon. This is a huge issue considering the version was bumped to 1.0.0 recently.

@appleboy appleboy changed the title fix: don't mutate logger, just make events from it fix(leak): don't mutate logger, just make events from it Mar 1, 2024
@appleboy appleboy merged commit 5a50b5f into gin-contrib:master Mar 1, 2024
8 checks passed
@appleboy
Copy link
Member

appleboy commented Mar 1, 2024

@mgabeler-lee-6rs mgabeler-lee-6rs deleted the fix/logger-reuse branch March 1, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#65 per-request allocation reduction destroys this module
6 participants